<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		<title>系统管理-用户管理</title>
		<jsp:include page="../../include/base.jsp"></jsp:include>
		<jsp:include page="../../include/common.jsp"></jsp:include>
		<script src="../LoginHandler.js" type="text/javascript"></script>
		<script src="../MainHandler.js" type="text/javascript"></script>
		<script src="userPanel.js" type="text/javascript" ></script>
		<script src="rolePanel.js" type="text/javascript" ></script>
		
		<style type="text/css">
    body {
        margin:0;padding:0;border:0;width:100%;height:100%;overflow:visible;
    }    
    <!-- 用于修正miniUI的分页条信息不显示的BUG  -->
    #userPager .mini-pager-left{position:absolute;top:0;left:0;}
    #userPager .mini-pager-right{position:absolute;top:0;right:0;}
    </style>
	</head>
	<body>
		<div class="mini-toolbar" style="border:0;font-size:12px;padding-left:6px;">
		     <a id="system_user_add" class="mini-button" iconCls="icon-addnew" plain="false" visible="false" onclick="UserPanel.add">新增用户</a>
		     <a id="system_user_edit" class="mini-button" iconCls="icon-edit" plain="false" visible="false" onclick="UserPanel.edit">编辑用户</a>
		     <a id="system_user_del" class="mini-button" iconCls="icon-remove" plain="false" visible="false" onclick="UserPanel.del">删除用户</a>
		     <a id="system_user_author" class="mini-button" iconCls="app-btn-tool" plain="false" visible="false" onclick="UserPanel.authorized">用户授权</a>
		     <span class="separator"></span>
		     <a id="system_user_refresh" class="mini-button" iconCls="icon-btn-refresh" plain="false" visible="false" onclick="UserPanel.reload">刷新</a>
		</div>
   
	    <div class="mini-fit" >
	        <div id="userDatagrid" class="mini-datagrid" fitColumns="true" multiSelect="false"
	        	  style="width:100%;height: 100%;" borderStyle="border-bottom:0;border-left:0;border-right:0;"
	              showFooter="false" idField="userId">
	            <div property="columns">
	            	<div type="checkcolumn"></div>
	                <div type="indexcolumn" width="60" headerAlign="center">序号</div>
	                <div field="nickName" width="130" headerAlign="center" allowSort="true">姓名</div>    
	                <div field="uname" width="130" headerAlign="center" allowSort="true">登录名</div>                            
	                <div field="ucode" width="130"  headerAlign="center">编码</div>
	                <div field="phone" width="120" align="center" allowSort="true" headerAlign="center">手机</div>                                    
	                <div field="remark" width="100%" allowSort="true" headerAlign="center">备注</div>
	                <div field="glText" width="120" allowSort="true" align="center" headerAlign="center">管理</div>
	            </div>
	        </div> 
		</div>
		<div class="mini-pager" id="userPager"  style="border-top: solid 1px #ccc;" onpagechanged="UserPanel.pagechanged" 
			sizeList="[5,10,20]" >
		</div>

		<div id="userEditWindow" class="mini-window" title="管理用户"
			style="width: 500px;" showModal="true" allowResize="false"
			allowDrag="true">
			<div id="userEditform" class="form">
				<input class="mini-hidden" name="userId" />
				<table style="width: 100%;">
					<tr>
						<td style="width: 100px;" align="right">登录名：</td>
						<td style="width: 200px;" align="center">
							<input name="uname" class="mini-textbox" required="true" style="width: 150px" /></td>
						<td style="color: red;">必填</td>
					</tr>
					<tr>
						<td style="width: 100px;" align="right">系统用户：</td>
						<td style="width: 200px;" align="center"><input name="issys" class="mini-checkbox" />是否系统用户</td>
						<td style="color: red;">（系统用户不能被删除）</td>
					</tr>
					<tr>
						<td style="width: 100px;" align="right">姓名：</td>
						<td style="width: 200px;" align="center">
							<input name="nickName" class="mini-textbox" style="width: 150px" />
						</td>
					</tr>
					<tr><td style="width: 100px;" align="right">编码：</td>
						<td style="width: 200px;" align="center">
							<input name="ucode" class="mini-textbox" required="true" style="width: 150px" />
						</td>
						<td style="color: red;">必填</td>
					</tr>
					<tr>
						<td style="width: 100px;" align="right">密码：</td>
						<td style="width: 200px;" align="center">
							<input name="password" class="mini-password" required="true" style="width: 150px" />
						</td>
						<td style="color: red;">必填 (1-16位)</td>
					</tr>
					<tr>
						<td style="width: 100px;" align="right">手机：</td>
						<td style="width: 200px;" align="center">
							<input name="phone" class="mini-textbox" style="width: 150px" />
						</td>
					</tr>
					<tr>
						<td style="width: 100px;" align="right">备注：</td>
						<td style="width: 200px;" align="center">
							<input name="remark" class="mini-textbox" style="width: 150px" />
						</td>
					</tr>
					<tr>
						<td
							style="text-align: center; padding-top: 5px; padding-right: 20px;"
							colspan="6">
							<a class="mini-button " plain="true" iconCls="icon-add"
								onclick="UserPanel.save">保存</a>
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<a class="mini-button" plain="true" iconCls="icon-remove"
								onclick="UserPanel.closeUserButton">关闭</a>
						</td>
					</tr>
				</table>
			</div>
		</div>

		<div id="roleEditWindow" class="mini-window" title="用户授权"
			style="width: 710px;" showModal="true" allowResize="false"
			allowDrag="true" >
			<span style="float: left;">
				<div id="roleDatagrid" class="mini-datagrid" showFooter="false" 
					style="width: 273; height: 350px;" idField="roleId"  multiSelect="true">
					<div property="columns">
						<div type="checkcolumn"></div>
						<div field="name" width="120" headerAlign="center" allowSort="true">
							已授权角色
						</div>
						<div field="code" width="120" headerAlign="center" allowSort="true">
							编码
						</div>
					</div>
				</div> </span>
			<span>
				<div id="funTreegrid" class="mini-treegrid"  
					style="width: 380px; height: 350px;padding-left: 15px;" showTreeIcon="true"
					treeColumn="name" idField="funId" parentField="pfunId" showCheckBox="true" 
					resultAsTree="false" iconField="funIcon" checkRecursive="true" autoCheckParent="true"  >
					<div property="columns">
						<div name="name" field="name" headerAlign="center" width="200">
							已授权功能
						</div>
						<div field="funCode" headerAlign="center" width="130">
							功能编码
						</div>
					</div>
				</div> </span><br />
				<center><span style="color: red">注：选中项表示已经授权，请为用户勾选需要授予的角色 和 功能权限！</span>
				</center>
				<br />
				<center><span>
					<a class="mini-button " plain="true" iconCls="icon-add" onclick="UserPanel.savePurview">保存</a>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
					<a class="mini-button" plain="true" iconCls="icon-remove"
				onclick="UserPanel.closeAuButton">关闭</a> 
				</span>
				</center><br />
		</div>

		<script type="text/javascript">
       		mini.parse();
			UserPanel.init();
			</script>
</body>
</html>